@extends('admin.layouts.admin')
@section('content')
    <div class="layui-form" lay-filter="LAY-add-forms" id="LAY-add" style="padding: 20px 30px 0 0;">
        <input type="hidden" name="type" value="{{$request->input_type}}">
        <div class="layui-form-item">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-block">
                <select name="setting_config_tab_id" lay-verify="">
                    @foreach($setting_config_tab as $key => $val)
                        <option value="{{$key}}" @if($key == $request->setting_config_tab_id) selected @endif>{{$val}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置名称</label>
            <div class="layui-input-block">
                <input type="text" name="info" lay-verify="info" autocomplete="off" placeholder="请输入配置名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">字段变量</label>
            <div class="layui-input-block">
                <input type="text" name="menu_name" lay-verify="required" placeholder="请输入字段变量" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置简介</label>
            <div class="layui-input-block">
                <input type="text" name="desc" lay-verify="required" placeholder="请输入配置简介" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-block">
                <textarea name="value" placeholder="请输入默认值" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文本框宽(%)</label>
            <div class="layui-input-block">
                <input type="text" name="width" value="100" lay-verify="required" placeholder="请输入文本框宽" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">多行文本框高(%)</label>
            <div class="layui-input-block">
                <input type="text" name="high" value="5" lay-verify="required" placeholder="请输入文本框宽" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="sort" lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" id="status" lay-skin="switch" lay-filter="switchTest" value="1" checked lay-text="显示|隐藏">

            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-add-forms" id="LAY-add-forms" value="确认">
        </div>
    </div>

@endsection
@section('scripts')
    <script>
        layui.config({
            base: '../' //静态资源所在路径
        }).extend({
            iconPicker: 'lib/extend/iconPicker'
        }).use([ 'table', 'form', 'layer' ,'iconPicker', 'util', 'element'], function(){
            var $ = layui.$
                ,form = layui.form
                ,layer = layui.layer
                ,iconPicker = layui.iconPicker
                ,element = layui.element;
            form.render('checkbox');

            iconPicker.render({
                // 选择器，推荐使用input
                elem: '#iconPicker',
                // 数据类型：fontClass/unicode，推荐使用fontClass
                type: 'fontClass',
                // 是否开启搜索：true/false，默认true
                search: true,
                // 是否开启分页：true/false，默认true
                page: true,
                // 每页显示数量，默认12
                limit: 12,
                // 每个图标格子的宽度：'43px'或'20%'
                cellWidth: '43px',
                // 点击回调
                click: function (data) {
                    console.log(data);
                },
                // 渲染成功后的回调
                success: function(d) {
                    console.log(d);
                }
            });

            /**
             * 选中图标 （常用于更新时默认选中图标）
             * @param filter lay-filter
             * @param iconName 图标名称，自动识别fontClass/unicode
             */
            iconPicker.checkIcon('iconPicker', 'layui-icon-star-fill');

        });//use

    </script>
@stop
